package com.han.elasticsearch.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import javax.persistence.Column;
import javax.persistence.Id;
import java.time.LocalDate;

/**
 * @author hanjl
 * @Description ES用户
 * @ClassName ElasticSearchUser
 * @createTime 2021/12/23 10:41
 */
@Document(indexName = "es-user")
@Data
@Setting(settingPath = "es_settings.json")
public class ElasticSearchUser {

    @Field(type = FieldType.Integer,store = true)
    private Integer id;

    @Field(type = FieldType.Text,store = true)
    private String name;

    @Field(type = FieldType.Integer,store = true)
    private Integer age;

    @Field(type = FieldType.Date,store = true)
    private LocalDate birth;

    @Field(type = FieldType.Text,store = true)
    private String remark;

    public ElasticSearchUser(){};

    public ElasticSearchUser(Integer id,String name,Integer age,LocalDate birth,String remark){
        this.id = id;
        this.name = name;
        this.age = age;
        this.birth = birth;
        this.remark = remark;
    }
}
